//package com.ftd.controller;
//
//import com.ftd.DBConnection.DBConnection;
//import com.ftd.model.Ebook;
//import com.ftd.viewmodel.ApiResult;
//import com.ftd.viewmodel.MapResult;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * Created by apple on 16/8/9.
// */
//@RestController
//public class EbookViewReadingController {
//    @RequestMapping("ebooKReadingJson")
//    public ApiResult ebookReadingJson(String index){
//        List<MapResult> mapList = new ArrayList<MapResult>();
//
//        ArrayList list = (ArrayList) DBConnection.select1("ebookTable");
//
//        MapResult mapResult = new MapResult();
//
//        for (int i = 0; i < list.size();i++) {
//            Ebook ebook = (Ebook)list.get(i);
//            if (ebook.getTag().equals(index)){
//                mapResult.put("bookName", ebook.geteBookName());
//                mapResult.put("imageUrl", ebook.geteImageUrl());
//                mapResult.put("review", ebook.geteBookReview());
//                mapResult.put("reading", ebook.geteBookReading());
//                mapResult.put("author",ebook.getAuthor());
//                break;
//            }
//            System.out.print(ebook.geteBookName());
//        }
//
//        return mapResult;
//    }
//}
